package test.ui {
	import gear.core.Game;
	import gear.net.AssetData;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.controls.GPoster;
	import gear.ui.core.GAlign;
	import gear.ui.core.GComponentData;
	import gear.utils.BDUtil;

	import flash.events.Event;

	/**
	 * TestGPoster 海报控件测试
	 * 
	 * @author bright
	 * @version 20101012
	 */
	public class TestGPoster extends Game {
		private var _poster : GPoster;

		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf")));
			RESManager.instance.add(new SWFLoader(new LibData("assets/mapThumbs.swf")));
			RESManager.instance.addEventListener(Event.COMPLETE, completeHandler);
			RESManager.instance.load();
		}

		private function completeHandler(event : Event) : void {
			testGPoster();
		}

		private function testGPoster() : void {
			var data : GComponentData = new GComponentData();
			data.width = 120;
			data.height = 90;
			data.align = GAlign.CENTER;
			_poster = new GPoster(data);
			addChild(_poster);
			_poster.model.source = [BDUtil.getBD(new AssetData("t_0", "mapThumbs")), BDUtil.getBD(new AssetData("t_1", "mapThumbs"))];
			_poster.selectionModel.index = 1;
		}

		public function TestGPoster() {
		}
	}
}
